
<!DOCTYPE html>
<html>
<head>
{include file="public/head"}
<body>
<div class="mfc headtop fl">
  <div class="mfc sreach fl">
    <div class="sreach-box">
      <span class="pabs-l-box fa fa-search" onclick="cat_tab_search()"></span>
      <input type="text" name="keywords" placeholder="请输入商品名称">

    </div>
  </div>
</div>
<div class="mfc mall bc-back fl">
  <div class="Split fl">
    <div class="left">
      <div class="left-menu">
        <ul class="tabox">
<!--          <li class="active" onclick="mallTypeTabox(this,1)">-->
<!--            独家甄选-->
<!--          </li>-->
          {volist name="data" id="vo"}
          <li onclick="cat_tab(this,{$vo.id})">
            {$vo.title}
          </li>
          {/volist}
        </ul>
      </div>
    </div>
    <div class="show cbox" id="mallTypeShow">
      <div class="mall-alist ssr">

<!--        <div class="mfc fl">-->
<!--          <div class="cell">-->
<!--            <div class="icon">-->
<!--              <div class="sicon"><img src="__MOBILE__/image/礼品套餐产品图1.png"></div>-->
<!--            </div>-->
<!--            <div class="info">-->
<!--              <h3 class="line2">来自烟台的美早大樱桃</h3>-->
<!--              <p class="line3">来自烟台的美早大樱桃，色泽鲜艳，晶莹剔透，香甜可口，营养丰富，是“果中珍品”，具有极高的营养价值和商业价值！</p>-->
<!--              <p class="option">-->
<!--                <span class="fa fa-cny c-red"></span><span class="fs18 c-red">120</span> <span class="fa fa-cny cost">280</span>-->
<!--                <span class="icon-cart-pink fr"></span>-->
<!--              </p>-->
<!--            </div>-->
<!--          </div>-->
<!--        </div>-->

      </div>
    </div>
  </div>
</div>

{include file="public/foot"}
</body>
</html>
<script>
  cat_tab(this,{$data.0.id});

  function cat_tab_search() {
      var title =  $('[name="keywords"]').val();
      if(!title){
          layer.msg('请输入商品名称');return false;
      }
      $.ajax({
          type: "POST", //用POST方式传输
          dataType: "json", //数据格式:JSON
          url: "{:url('cat_one')}?title="+title, //目标地址
          async: false,
          traditional :false,
          // data:{distribution_type:distribution_type,order_number:order_number},
          success: function (ret) {
              console.log(ret);
              var str = '';

              $.each(ret.data,function (k,v) {
                  var url = "{:url('goods_view')}?id="+v.id;
                  str += '        <a href="'+url+'"> <div class="mfc fl">' +
                      '          <div class="cell">' +
                      '            <div class="icon">' +
                      '              <div class="sicon"><img src="'+v.single_pic+'"></div>\n' +
                      '            </div>\n' +
                      '            <div class="info">' +
                      '              <h3 class="line2">'+v.title+'</h3>\n' +
                      '              <p class="line3">'+v.describe+'</p>\n' +
                      '              <p class="option">' +
                      '                <span class="fa fa-cny c-red"></span><span class="fs18 c-red">'+v.price+'</span> <span class="fa fa-cny cost">'+v.line_price+'</span>\n' +
                      '                <span class="icon-cart-pink fr"></span>\n' +
                      '              </p>\n' +
                      '            </div>\n' +
                      '          </div>\n' +
                      '        </div></a>';
              });
              $('.ssr').html(str);



          }
      });
  }
  function cat_tab(t,cat_id) {
    $.ajax({
      type: "POST", //用POST方式传输
      dataType: "json", //数据格式:JSON
      url: "{:url('cat_one')}?cat_id="+cat_id, //目标地址
      async: false,
      traditional :false,
      // data:{distribution_type:distribution_type,order_number:order_number},
      success: function (ret) {
        console.log(ret);
        var str = '';

        $.each(ret.data,function (k,v) {
          var url = "{:url('goods_view')}?id="+v.id;
          str += '        <a href="'+url+'"> <div class="mfc fl">' +
                  '          <div class="cell">' +
                  '            <div class="icon">' +
                  '              <div class="sicon"><img src="'+v.single_pic+'"></div>\n' +
                  '            </div>\n' +
                  '            <div class="info">' +
                  '              <h3 class="line2">'+v.title+'</h3>\n' +
                  '              <p class="line3">'+v.describe+'</p>\n' +
                  '              <p class="option">' +
                  '                <span class="fa fa-cny c-red"></span><span class="fs18 c-red">'+v.price+'</span> <span class="fa fa-cny cost">'+v.line_price+'</span>\n' +
                  '                <span class="icon-cart-pink fr"></span>\n' +
                  '              </p>\n' +
                  '            </div>\n' +
                  '          </div>\n' +
                  '        </div></a>';
        });
        $('.ssr').html(str);



      }
    });
  }
</script>